var mongoose = require("mongoose");
var Schema = mongoose.Schema;

const RentSchema = new Schema(
  {
    bike_id: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "bikes",
    },
    user_id: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "users",
    },
    end_data: { type: Date },
    start_date: {
      type: Date,
      default: Date.now(),
    },
  },
  {
    versionKey: false,
  }
);
module.exports = User = mongoose.model("rents", RentSchema);
